function wel(user){
  return 'wel: $(user)'
}
// 添加图片
function tapCamera(imgData) { 
  var allowUploadPicCount = 3;
  var imgDataLength =  imgData.length;
  allowUploadPicCount = allowUploadPicCount - imgDataLength;
  // 选择图片
  wx.chooseImage({
    count: allowUploadPicCount, // 默认9
    sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
    sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
    success: function (res) {
      var tempFilePaths = res.tempFilePaths
      var length = tempFilePaths.length 
      // 未选择图片
      if (tempFilePaths.lenghth === 0) {
        return
      } 
      var obj = {
        filePath: tempFilePaths,
        formData: {
          path: 'comment'
        },
        success: function (filesArr) {
          var imgData =  imgData 
          if (filesArr.length != 0) {
            filesArr.forEach(function (item, index) {
              imgData.push(item)
            })
          } else {
            return
          }

          self.setData({
            imgData: imgData
          })
        }
      } 
      // 上传图片
      util.uploadPics(obj)
    },
    fail: function (err) {
      console.log(err)
    }
  })
}
module.exports.wel = wel